{extend name="public/base" /}

{block name="title"}<title>{$Think.lang.list}</title>{/block}

{block name="pjax_container"}
<div class="hry-content-wrapper">
<section class="content-header">
    <ol class="breadcrumb">
        <li>企业端管理</li>
        <li class="active">用款申请</li>
    </ol>
</section>
<section class="content">
    <div class="row">
        <div class="col-md-12">
            <div class="hry-form-wrapper">
                <div class="box-header with-border" style="padding:15px;">
                    <h3 class="box-title"></h3>
                    {include file="public/project_side_divide_money_search" /}
                </div>
                <div class="box-body table-responsive">
                    <table class="table table-bordered table-hover table-sort">
                        <tr>
                            <th>项目ID{:table_sort('id')}</th>
                            <th>项目名称</th>
                            <th>项目方</th>
                            <th>申请金额</th>
							<th>状态</th>
							<th>创建时间</th>
                            <th width="178">{$Think.lang.action}</th>
                        </tr>
                        {volist name="dataList" id="vo"}
                        <tr>
                            <td>{$vo.id}</td>
                            <td>{$vo.project_name}</td>
                            <td>{$vo.company_name}</td>
                            <td>{$vo.money}</td>
                            {if condition=" $vo.status == 1 "}
                            <td><span class="status status-warning">待审核</span></td>
                            {/if}
                            {if condition=" $vo.status == 2 "}
                            <td><span class="status status-success">已通过</span></td>
                            {/if}
                            {if condition=" $vo.status == 3 "}
                            <td><span class="status status-error">已拒绝</span></td>
                            {/if}
							<td>{$vo.time}</td>
                            <td>
                                {if condition=" $vo.status==1 "}
                                <a class="btn-text btn-primary" href="{:url('ProjectSide/detaildividemoney',['id'=>$vo.id])}">审核</a>
                                {/if}
                                {if condition=" $vo.status==2 && $vo.relevance_status>1 "}
                                <a class="btn-text btn-primary" href="{:url('ProjectSide/ProjectDaiFu')}?afm_id={$vo.id}&has_bind_list=1">查看关联订单</a>
                                {/if}

                            </td>
                        </tr>
                        {/volist}
                    </table>
                </div>
                <div class="box-footer clearfix">
                    {$dataList->render()}
                </div>
            </div>
        </div>
    </div>
</section>
</div>
<script type="text/javascript">
$(function(){
    /*ajax页面加载icheck，有该控件的页面才需要*/
    $('input[type="checkbox"].minimal, input[type="radio"].minimal').iCheck({
        checkboxClass: 'icheckbox_minimal-blue',
        radioClass: 'iradio_minimal-blue'
    });
    
    /*ajax页面加载icheck，有该控件的页面才需要*/
    $(".select2").select2({language:"zh-CN"});
    
    /*全选-反选*/
    $('.checkbox-toggle').on('ifChecked', function(event){
        var _this = $(this);
        var _table = _this.closest('.table');
        _table.find("tr td input[type='checkbox']").iCheck("check");
    });
    $('.checkbox-toggle').on('ifUnchecked', function(event){
        var _this = $(this);
        var _table = _this.closest('.table');
        _table.find("tr td input[type='checkbox']").iCheck("uncheck");
    });
    
    $('.editable').editable({
        emptytext: "empty",
        params: function(params) {      //参数
            var data = {};
            data['id'] = params.pk;
            data[params.name] = params.value;
            return data;
        },
        success: function(response, newValue) {
            var res = $.parseJSON( response );
            if(res.status == 1){
            }else{
                return res.info;
            }
        }
    });
    
    {if condition=" $rest_login == 1 "}
    restlogin('{$rest_login_info}');   //登录超时
    {/if}
})
$(".ss").on('click','', function(){
    data=$(this).data("id");
    $.ajax({
        url:"batchht",
        data:{
            id:data
        },
        type:"POST",
        dataType:"json",
        success:function(JSON){
            console.log(JSON);
            $.amaran({'message':JSON.info})
//                    debugger;
        },
        error:function(xhr,status,errorThrown){
//                    debugger;
        },
        complete:function(xhr,status){
//                    alert('The request is complated');
        },
        beforesend:function(){
        },
        cache:false,//true
        async:true
    });//ajax end here
});
</script>
<style>
    .status{
        display: inline-block;
        padding: 3px 15px;
        color: white;
        border-radius: 15px;
        font-size: 12px;
    }
    .status-error{
        background: #f5222d;
    }
    .status-success{
        background: #52c41a;
    }
    .status-warning{
        background: #faad14;
    }
</style>
{/block}